<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>首页-穿越火线周边商城</title>
  <link rel="Shortcut Icon" href="../images/10001.ico" type="image/x-icon" />

  <link rel="stylesheet" href="../css/login.css" />
  <script src="../js/axios0.27.2.js"></script>
  <script src="../js/request.js"></script>
</head>

<body>
  <div class="wrap"></div>
  <div class="login">
    <a href="../index.html" id="close" title="关闭"></a>
    <ul class="tablist" id="tablist">
      <li class="listqq active"><i class="iconqq"></i><span>QQ账号登陆</span></li>
      <li class="listwx"><i class="iconwx"></i><span>微信账号登陆</span></li>
    </ul>
    <div class="login-tips">微信和QQ是两个独立账号，账号信息不互通</div>
    <div class="select">
      <div class="tips" id="tips">
        <div class="title" id="title_2">密码登录</div>
        <div id="qlogin_entry">
          推荐使用<a class="switch_btn_focus link_tips" hidefocus="true" id="switcher_qlogin" href="javascript:void(0);"
            tabindex="7">快捷登录</a>，防止盗号。
        </div>
      </div>
      <div class="login-form">
        <input type="text" placeholder="支持QQ号/邮箱/手机号登录" class="account">
        <input type="password" name="" class="password" placeholder="请输入密码"><br>
        <input type="button" value="登录" class="submit">
      </div>
      <div class="bottom" id="bottom_web" style="display: block;">
        <a href="https://ssl.ptlogin2.qq.com/ptui_forgetpwd" class="link" id="forgetpwd" target="_blank">找回密码</a>
        <span class="dotted"></span>
        <a href="./register.html" class="link" target="_blank">注册帐号</a>
        <span class="dotted"></span>
        <a class="link" id="feedback_web" href="https://support.qq.com/products/14800" target="_blank">意见反馈</a>
      </div>
    </div>
  </div>
  </div>
  <script>
    let ipts = document.querySelectorAll("input");
    console.log(ipts);
    ipts[2].onclick = () => {
      let userName = ipts[0].value;
      let password = ipts[1].value;
      myAxios.post(loginAPI, { userName, password }).then((r) => {
        if (r.data.code == 1) {
          localStorage.setItem("token", r.data.data);
          localStorage.setItem("userName", userName);
          localStorage.setItem("password", password);
          setTimeout(function () {
            alert("登录成功");
            location.href = "../index.html";
          }, 500)
        } else {
          alert(r.data.data);
        }
      });
    };
  </script>
</body>

</html>